package com.lvan.controller.common;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lvan.bean.BaseException;
import com.lvan.bean.Page;
import com.lvan.bean.Remind;
import com.lvan.controller.BaseController;
import com.lvan.service.interfaze.common.IRemindService;

@Controller
@RequestMapping("/remind")
public class RemindController extends BaseController{
	@Autowired
	private IRemindService remindService;
	
	@RequestMapping(value="/query")
	public String query(ModelMap model,Page page, Remind r, HttpServletRequest request) {
		List<Remind> ls = remindService.query(r, page);
		model.put("data", ls);
		return INDEX;
	}
	
	@RequestMapping(value="/delete")
	public void delete(String id, HttpServletRequest request) throws BaseException {
		this.remindService.delete(id);
	}
	
	@RequestMapping(value="/add")
	public String add(Remind r, HttpServletRequest request) throws BaseException {
		this.remindService.add(r);
		return INDEX;
	}
	
	@RequestMapping(value="/update")
	public String update(Remind r, HttpServletRequest request) throws BaseException {
		this.remindService.update(r);
		return INDEX;
	}
}
